<template>
	<view style="position: relative;">
		<view class="mp-search-box" ref="head" :style="{backgroundColor:titleNViewBackground}" style="padding-top: 0upx;">
			<image src="../../static/144.png" style="width: 50upx;height: 50upx;position: absolute;top: 80upx;left: 25upx;" mode="" @click="jumpgo" data-src='/pages/us/us'></image>
			<image src="../../static/fangdajing.png" style="width: 40upx;height: 40upx;position: absolute;top: 80upx;left: 100upx;z-index: 2;" @click="searchgoGoods"></image>
			<input class="ser-input" type="text" placeholder="输入关键字搜索" style="position: absolute;top: 70upx;left: 90upx;" placeholder-style="color:#aaa;font-size:28upx" @click="searchgoGoods"/>
			<image @click="jumpgo" data-src='/pages/media/media' src="../../static/xiaoxi1.png" style="width: 48upx;height: 48upx;position: absolute;top: 80upx;right: 25upx;"></image>
		</view>
		<view v-for="(res,index) in data" :key="index">
			<!-- 头部轮播 banner -->
			<view v-if="res.id == 'banner'">
				<view class="carousel-section">
					<view class="titleNview-placing"></view>
					<view class="titleNview-background" :style="{backgroundColor:titleNViewBackground}"></view>
					<swiper class="carousel" circular autoplay duration="1000" @change="swiperChange">
						<swiper-item v-for="(item, index) in res.data" :key="index" class="carousel-item">
							<image :src="item.imgurl" mode="widthFix" @click="jumptomenu(item)"/>
						</swiper-item>
					</swiper>
					<!-- <view class="swiper-dots">
						<text class="num">{{swiperCurrent+1}}</text>
						<text class="sign">/</text>
						<text class="num">{{swiperLength}}</text>
					</view> -->
				</view>
				<!-- <swiper autoplay="true" indicator-dots="true" circular="true" style="height: 422upx;">
					<swiper-item v-for="(item,i) in res.data" :key="i" @click="jumptomenu(item)">
						<image :src="item.imgurl"  style="height: 422upx;width: 100%;" model="aspectFill" />
					</swiper-item>
				</swiper> -->
			</view>
			
			<!-- menu2 -->
			<view v-if="res.id == 'menu2'">
				<view class="tab_choose">
					<text class="menu_son">
						<text class="iconfont">&#xe654; </text> 
						<text class="padleft"> 自购轻松省</text>
					</text>
					<text class="menu_son">
						<text class="iconfont">&#xe654; </text> 
						<text class="padleft"> 分享简单赚</text>
					</text>
					<text class="menu_son">
						<text class="iconfont">&#xe654;</text> 
						<text class="padleft"> 百分百正品</text>
					</text>
				</view>
			</view>
			<!-- blank -->
			<view v-if="res.id == 'blank'">
				<view :style="{background:res.style.background,height:res.style.height *2 + 'upx'}"></view>
			</view>
			<!-- title -->
			<view v-if="res.id == 'title'">
				<view class="d-header" style="font-weight: 555;height: 110upx;line-height: 110upx;">
					<text v-if="res.params.title">{{res.params.title}}</text>
				</view>
			</view>
			<!-- menu -->
			<view v-if="res.id == 'menu'">
				<swiper v-if="res.data_temp" indicator-dots="true" style="height: 222upx;" :style="{background:res.style.background}">
					<swiper-item v-for="(menu,index1) in res.data_temp" :key="index1" class="webkit">
						<view v-for="(item,index2) in menu" :key="index2" style="width: 150upx;padding: 20upx 0;" @click="jumptomenu(item)"
						 data-src='item.linkurl'>
							<image :src="item.imgurl" style="width: 88upx;height: 88upx;margin: 0 auto;display: block;"></image>
							<text style="display: block;text-align: center;font-size: 24upx;padding: 8upx;" :style="{color:item.color}">{{item.text}}</text>
						</view>
					</swiper-item>
				</swiper>
				<view v-else class="webkit flexbox">
					<view v-for="(item,i) in res.data" :key="i" :style="{background:res.style.background,width: 100 /res.style.rownum +'%'}"
					 @click="jumptomenu(item)" style="padding: 20upx 0;" class="flexboxson">
						<image :src="item.imgurl" style="width: 88upx;height: 88upx;margin: 0 auto;display: block;"></image>
						<text style="display: block;text-align: center;font-size: 24upx;padding: 8upx;" :style="{color: item.color}">{{item.text}}</text>
					</view>
				</view>
			</view>
			<!-- notice  公告-->
			<view v-if="res.id == 'notice'">
				<view class="uni-swiper-msg" :style="{background:res.style.background}" style="padding: 12upx;width: 726upx;">
					<view class="uni-swiper-msg-icon" style="width: 70upx;">
						<view style="color: #b25415;padding-left: 10upx;">热点</view>
					</view>
					<image src="../../static/notification.png" style="width: 32upx;height: 32upx;margin-top: 10upx;margin-right: 12px;"
					 mode=""></image>
					<swiper vertical="true" autoplay="true" circular="true" interval="3000" class="flex">
						<swiper-item v-for="(item, index3) in res.data" :key="index3">
							<navigator :style="{color:res.style.color}" style="font-size: 24upx;" class="ellipsis-1">{{item.title}}</navigator>
						</swiper-item>
					</swiper>
				</view>
			</view>
			
			<view v-if="res.id == 'picturew'">
				<view v-if="res.params.row == '4'"  style="display: flex;">
					<view style="width: 400upx;height: 200upx;margin: 5upx;" v-for="(item,index4) in res.data" :key="index4" >
						<image :src="item.imgurl" style="width: 100%;height: 100%;" mode="widthFix" @click="jumptomenu(item)"></image>
					</view>
				</view>
				<!-- 堆积两列 -->
				<view v-if="res.params.row == '2'">
					<view style="width: 360upx;height: 200upx;margin: 5upx;display: inline-block;" v-for="(item,index4) in res.data" :key="index4" >
						<image :src="item.imgurl" style="width: 100%;height: 100%;" mode="widthFix" @click="jumptomenu(item)"></image>
					</view>
				</view>
				<!-- 堆积三列 -->
				<view v-if="res.params.row == '3'">
					<view style="width: 240upx;height: 200upx;margin: 5upx;display: inline-block;" v-for="(item,index4) in res.data" :key="index4" >
						<image :src="item.imgurl" style="width: 100%;height: 100%;" @click="jumptomenu(item)"></image>
					</view>
				</view>
				<!-- picturew 橱窗布局 -->
				<view v-if="res.params.row == '1'" class="p_father">
					<view class="p_left">
							<image :src="picturew[0].imgurl" @click="jumptomenu(picturew[0])"></image>
							<!-- @click="jump_1" -->
						</view>
						<view class="p_right">
							<view class="img_top">
								<image :src="picturew[1].imgurl" @click="jumptomenu(picturew[1])"></image>
							</view>
							<view class="img_bottom" v-if="picturew[2]">
								<view>
									<image :src="picturew[2].imgurl" @click="jumptomenu(picturew[2])"></image>
								</view>
								<view v-if="picturew[3]">
									<image :src="picturew[3].imgurl" @click="jumptomenu(picturew[3])"></image>
								</view>
							</view>
						</view>
				</view>
			</view>
			
			
			
			<view v-if="res.id == 'blank'" :style="{background:res.style.background,'height': res.style.height+'px'}" ></view>
			
			
			
			<!-- picture -->
			<view v-if="res.id == 'picture'" style="overflow: hidden;margin: 0 20upx;">
				<image v-for="(item,index5) in res.data" :key="index5" :src="item.imgurl" style="width: 100%;"
				 :style="{'padding-right':res.style.paddingleft * 2 +'upx','padding-top':res.style.paddingtop * 2 +'upx','padding-bottom':res.style.paddingtop * 2 +'upx'}" @click="jumptomenu(item)" mode="widthFix"></image>
			</view>
			<!-- goods 商品主题场列表-->
			<view v-if="res.id == 'goods'" class="clear" :class="res.style.liststyle">
				<view v-for="(item,i) in res.data" :key="i" class="item" @click="jumpgoods" :data-id='item.gid'>
					<image class="triangle" :src="item.thumb"></image>
					<view class="detail">
						<view class="name" :style="{color:res.style.titlecolor}">{{item.title}}</view>
						<view class='productprice' v-if="res.params.showproductprice == 1" :style="{color:res.style.productpricecolor}" style="position: relative;" >
							<text style="text-decoration:line-through;">{{res.params.productpricetext}}{{item.productprice}}</text>
							<text v-if="res.params.showsales != 1" style="position: absolute;right: 0;top: 0;">库存{{item.total}}</text>
						</view>
						<view class='sale' v-if="res.params.showsales == 1" :style="{color:res.style.salescolor}" style="position: relative;">
							<text>{{res.params.salestext}}{{item.sales}}</text>
							<text style="position: absolute;right: 0;top: 0;">库存{{item.total}}</text>
						</view>
						<view class="price webkit" v-if="res.params.showprice == 1">
							<text style="font-size: 28upx;" class="flex" >¥{{item.price}}</text>
						</view>
					</view>
				</view>
			</view>
			
			<!-- update -->
			<view class="mask" :class="show" @touchmove.stop.prevent="hide"></view>
			<view class="mask" :class="show2" @touchmove.stop.prevent="hide"></view>
			<view class="gengxing" :class="show2" :style="{pointerEvents:pointerevents}">
				<image src="../../static/update_bg3.png" style="width: 480upx;height: 732upx;position: absolute;bottom: 0;z-index: 2;"></image>
				<!-- 更新进度条 -->
				<view v-if="show8 == 0">
					<view style="background: rgba(255, 0, 0, 0.2);width: 480upx;height: 100upx;position: absolute;z-index: 9999;bottom: 0;" :style="{'right':right}"></view>
					<view class="title">发现新版本<text >v{{version}}</text></view>
					<view style="position:absolute;bottom:310upx;width:100%;text-align:center;z-index: 999;color: #db3737;">{{newtext}}</view>
					<view style="position:absolute;top:460upx;width:100%;text-align:center;">
						
					</view>
					<button class="dl" @click="download" v-if="link == '4G'">{{dlbtn}}</button>
					<button class="dl" v-else>{{dlbtn}}</button>
				</view>
			</view>
			
		</view>
		<uni-popup ref="popup" @towangzhan='towangzhan' @xieyi='xieyi' type="bottom"></uni-popup>
	</view>
</template>

<script>
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	import uniIcon from '@/components/uni-icon.vue'
	import uniCountdown from '@/components/uni-countdown/uni-countdown.vue'
	import BottomImageMenu from '@/components/bottom-mask/bottom-mask.js'
	// #ifdef APP-PLUS
	var bottomImageMenu = new BottomImageMenu(() => {})
	// #endif
	export default {
		components: {
			uniIcon,
			uniCountdown,
			uniPopup,
			uniPopupMessage,
			uniPopupDialog
		},
		onShareAppMessage(res) {
			if (res.from === 'button') {// 来自页面内分享按钮
			}
			if (this.pid_father == '' || this.pid_father == undefined || this.pid_father== null){
				uni.navigateTo({
					url: '../login/login'
				})
			}
			return {
				title: 'adkk商城',
				path: '/pages/home/home?pid=' + this.pid_father
			}
		},
		onReady:function(){
			this.show8 = 0
		},
		data() {
			return {
				openid:'',
				data: {},
				appversion: '',
				version: '',
				show: '',
				show2: "",
				show3:'show',
				show8:'',
				link: "",
				dlbtn: "",
				newtext: "",
				right: '100%',
				titleNViewBackground: '', //轮播图区域
				swiperCurrent: 0,
				swiperLength: 0,
				goodsList: [],
				backgroundColor:'transpant',
				pointerevents:'auto',
				ad: true,
				video_show: true,
				adv:{},
				autoclose:'',
				picturew:[],
				background:'',
				muted: false,
				path: 'http://adkk.mygodmall.com/video.mp4',
				pid_father:'',
				tongyi:'',
			};
		},
		onShow:function(){
		  
		  uni.getStorage({
		   key: 'openid',
		   success: (res) => {
		    this.openid = res.data
		   },
		   // fail: () => {
		   //  uni.navigateTo({
		   //   url: '../login/login'
		   //  });
		   // }
		  });
			uni.request({
				url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.getappversion&app=1',
				data:{
					openid: this.openid
				},
				header:{'Content-Type':'application/x-www-form-urlencoded'},
				method: 'POST',
				success: res => { 
					console.log(res)
					this.tongyi = res.data.tongyi
					if(this.tongyi == 1){
						this.open()
						uni.hideTabBar({})
					}
				},
				fail: () => {},
				complete: () => {},
			});
		 },
		onLoad: function(e) {
			// this.muted = false
			let o = this
			uni.getStorage({
			 key: 'openid',
			 success: (res) => {
			  this.openid = res.data
				uni.request({
					url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.getappversion&app=1',
					data:{
						openid: this.openid
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					method: 'POST',
					success: res => { 
						console.log(res)
						this.tongyi = res.data.tongyi
						if(this.tongyi == 1){
							this.open()
							uni.hideTabBar({})
						}
					},
					fail: () => {},
					complete: () => {},
				});
			 },
			 });
			uni.getStorage({
				key: 'pid_father', // 个人中心页获取的分享id
				success: (res) => {
					this.pid_father = res.data
				}
			});
			uni.request({
				url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&app=1',
				success: res => {
					
					this.data = res.data
					// 处理广告栏数据
					this.adv = res.data.adv
					if (this.adv.data != null ||  this.adv.data != undefined) {
						this.autoclose = res.data.adv.params.autoclose
						if(this.adv.status == 1) {
							setTimeout(function() {
								o.show3 = ''
							}, o.autoclose*1000);
						}
					} else {
						this.ad = false
					}
					
					for (var i in this.data) {
						if (this.data[i].id == 'menu') {
							if (this.data[i].data_temp == undefined) {
								this.data[i].style.width = 375 / this.data[i].style.rownum + 'px'
							}
						}
						if (this.data[i].id == 'banner') {
							let a = this.data[i].data
							var count = 0;
							for (var i in a) {
							    if (a.hasOwnProperty(i)) {
							        count++;
							    }
							}
							this.swiperLength = count
							for (let j in a) {
								console.log(a[j])
								this.titleNViewBackground = a[j].backgrounds
								return
							}
						}
						
					}
				},
				fail: () => {},
				complete: () => {}
			});
			if(uni.getSystemInfoSync().platform === 'android') {
				console.log(this.openid)
				uni.request({
					url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.getappversion&app=1',
					data:{
						openid: this.openid
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					method: 'POST',
					success: res => { 
						console.log(res)
						this.tongyi = res.data.tongyi
						if(this.tongyi == 1){
							this.open()
							uni.hideTabBar({})
						}
						//#ifdef APP-PLUS
						this.tongyi = res.data.tongyi
						if(this.tongyi == 1){
							this.open()
							uni.hideTabBar({})
						}
						var edition = plus.runtime.version //获取当前版本号：1.0.1
						//将版本号转变为101格式
						edition = edition.split(".")
						var ary = ''
						for (var i in edition) {
							ary += edition[i]
						}
						// if (res.data.version > ary) { //判断如果版本低于服务器版本
						if (res.data.version != ary) { //判断如果版本低于服务器版本
						console.log(res.data.version)
							this.ad = false  // 更新时阻止弹出系统广告
							//将版本号101转变为1.0.1格式
							var newversion = ''
							for (var i in res.data.version) {
								newversion += res.data.version[i] + '.'
							}
							this.version = newversion.slice(0, newversion.length - 1)
							//------------------
							this.show2 = 'show' //蒙版出现
							bottomImageMenu.show() // 遮挡底部菜单栏的蒙版
							if (plus.networkinfo.getCurrentType() != 3) { //如果不是WIFI
								this.link = '4G'
								this.dlbtn = '使用流量下载'
								this.newtext = '您当前未使用wifi，已停止下载'
								var nowlink = setInterval(() => {
									if (plus.networkinfo.getCurrentType() == 3) {
										clearInterval(nowlink)
										this.download()//下载
									}
								}, 2000)
							} else {
								this.download()//下载
							}
						}
						//#endif
					},
					fail: () => {},
					complete: () => {},
				});
			}
			if(uni.getSystemInfoSync().platform === 'ios') {
				uni.request({
					url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.getappversion&app=1',
					method: 'POST',
					success: res => { 
						//#ifdef APP-PLUS
						console.log(res.data)
						var edition = plus.runtime.version //获取当前版本号：1.0.1
						
						//将版本号转变为101格式
						edition = edition.split(".")
						var ary = ''
						for (var i in edition) {
							ary += edition[i]
						}
						// if (res.data.version > ary) { //判断如果版本低于服务器版本
						if (res.data.ios != ary) { //判断如果版本低于服务器版本
						// console.log(res.data.ios)
						// console.log(ary)
							this.ad = false  // 更新时阻止弹出系统广告
							//将版本号101转变为1.0.1格式
							// var newversion = ''
							// for (var i in res.data.version) {
							// 	newversion += res.data.version[i] + '.'
							// }
							// this.version = newversion.slice(0, newversion.length - 1)
							//------------------
							uni.showModal({
								title: "更新",
								content: '有新的功能推送哦~',
								success: function (res) {
								 if (res.confirm) {
									 plus.runtime.openURL('http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=account.download')
								 } else if (res.cancel) {
									 // console.log('用户点击取消');
								 }
								}
							})
						}
						//#endif
					},
					fail: () => {},
					complete: () => {},
				});
			}
		},
		// onHide () {
		// 	this.muted = true
		// },
		methods: {
			// 页面滚动事件
			// onPageScroll(){
			// 	// if (scrollTop<=100) {
			// 	// 	this.backgroundColor = 'black'
			// 	// }
			// 	this.backgroundColor = '#C45952'
			// },
			//轮播图切换修改背景色
			swiperChange(e) {
				const index = e.detail.current;
				this.swiperCurrent = index;
				var arr = []
				for (var i in this.data) {
					if (this.data[i].id == 'banner') {
						let a = this.data[i].data
						for (let j in a) {
						    arr.push(a[j]); //属性
						}
						this.titleNViewBackground = arr[index].backgrounds;
					}
				}
			},
			 open(){
							 this.$refs.popup.open()
			 },
			 towangzhan(){
				window.location.href = 'http://www.yirenhuigroup.com'
			 },
			 xieyi(){
				 uni.request({
				 	url: 'http://adkk.mygodmall.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.tongyi&app=1',
				 	data:{
				 		openid: this.openid
				 	},
				 	header:{'Content-Type':'application/x-www-form-urlencoded'},
				 	method: 'POST',
				 	success: res => { 
				 		console.log(res)
				 		uni.showTabBar({})
				 	},
				 	fail: () => {},
				 	complete: () => {},
				 });
			 },
			jump() {
				uni.showModal({
				title:'提示',
				content:'功能即将开放',
				showCancel: false,
				confirmColor:"#DD524D",
					success() {
						return
					}
				})
			},
			jumpgo(e){
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
			jumptomenu(item) {
				if(item.linkurl=="" || item.linkurl== undefined) {
					uni.showModal({
					title:'提示',
					content:'即将开放',
					showCancel: false,
					confirmColor:"#DD524D",
						success() {
							return
						}
					})
					return
				}
				// if (item.linkurl != "" || item.linkurl != undefined) { // 跳转到任意页
				// 	uni.navigateTo({
				// 		url: item.linkurl
				// 	});
				// 	return
				// }
				// 跳转到文章页
				if (item.linkurl == "../media/media") {
					uni.navigateTo({
						url: '../media/media'
					});
					return
				}
				if (item.linkurl == "../commission/qrcode/invite_code") {
					uni.navigateTo({
						url: '../commission/qrcode/invite_code'
					});
					return
				}
				if (item.linkurl == "../member/member") {
					uni.reLaunch({
						url: '../member/member'
					})
					return
				}
				if (item.linkurl.indexOf("points_mall/points_mall") != -1) { // 积分商城
					uni.navigateTo({
						url: '../../pageA/member/points_mall/points_mall'
					})
					return
				}
				if (item.linkurl == "../commission/qrcode/invite_code") {
					uni.navigateTo({
						url: '../commission/qrcode/invite_code'
					});
					return
				}
				item = item.linkurl
				console.log(item)
				let obj = {};
				let arr1 = item.split("?");
				let arr2 = arr1[1].split("&");
				for(let i=0 ; i < arr2.length; i++){
					let res = arr2[i].split("=");
					obj[res[0]] = res[1];
				}
				item = obj
				// 跳转到自定义页面
				if (item.r == "diypage") {
					uni.navigateTo({
						url: '../goods/spree/spree?id=' + item.id
					});
				}
				if (item.r == "goods.detail") {
					uni.navigateTo({
						url: '../goods/detail?goodsid=' + item.id
					});
				}
				if (item.r == "article") {
					uni.navigateTo({
						url: '../../pageA/essay/essay?essaysid=' + item.aid
					});
				}
				if (item.r == "articlecategory") {
					uni.navigateTo({
						url: '../media/media?id=' + item.id
					});
				}
				
				if (item.r == "goods") {
					uni.navigateTo({
						url: '../goods/goods?cate=' + item.cate
					});
				}
				if (item.r == "commission.qrcode") {
					uni.navigateTo({
						url: '../commission/qrcode/invite_code'
					});
				}
				if (item.r == "sign") {
					uni.navigateTo({
						url: '../../pageA/member/sign/sign'
					});
				}
			},
			searchgoGoods(){
				uni.reLaunch({
					url: '../shop/category'
				})
			},
			jumpgoods(e) {
				uni.navigateTo({
					url: '../goods/detail?goodsid=' + e.currentTarget.dataset.id
				});
			},
			hide() {
				this.newLogin = ''
				this.show = ''
			},
			hide1() {
				this.show3 = ''
			},
			download() {
				this.pointerevents = 'none'
				this.link = 'wifi'
				this.dlbtn = '正在下载 0%'
				this.newtext = '正在后台下载，请稍后'
				let _this = this
				var downToak = plus.downloader.createDownload('http://adkk.mygodmall.com/adkk.apk', { //拿到下载任务的对象
					filename: '_doc/update/'
				}, function(d, status) {
					plus.nativeUI.closeWaiting();
					if (status == 200) { //在回调中根据状态 进行操作
						plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), {}, {}, function(error) {
							uni.showToast({
								title: '安装失败',
								mask: false,
								duration: 1500
							});
						})
					} else {
						app.alert("配置出错,请检查网络链接！");
					}
				});
				downToak.start(); // 开启下载的任务
				var prg = 0;
				downToak.addEventListener("statechanged", function(task, status) { //给下载任务设置一个监听 并根据状态  做操作
					switch (task.state) {
						case 1:
							break;
						case 2:
							break;
						case 3:
							prg = parseInt(parseFloat(task.downloadedSize) / parseFloat(task.totalSize) * 100);
							_this.dlbtn = '正在下载 ' + prg + '%'
							_this.right = 100 - Number(prg) + '%'
							break;
						case 4:
							break;
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;// 页面的整体背景色
	}
	
	
	.mp-search-box{
		width: 100%;
		height: 145upx;
		position:fixed;
		left: 0;
		top: 0;
		// top: 72upx;
		z-index: 9;
		// padding: 0 80upx;
		// background-color: rgba($color: #BE473F, $alpha: 0.5);
		.ser-input{
			width: 76%;
			height: 56upx;
			// margin-top: 60upx;
			line-height: 56upx;
			text-align: center;
			font-size: 28upx;
			border-radius: 20px;
			background-color: #ddd;
			border: 1px solid #ccc;
		}
	}
	
	.controls-title {
			width: 100%;
			text-align: center;
			color: #FFFFFF;
	}
	
	
	.m-t{
		margin-top: 16upx;
	}
	/* 头部 轮播图 */
	.carousel-section {
		position: relative;
	
		.titleNview-placing {
			height: var(--status-bar-height);
			padding-top: 14px;
			box-sizing: content-box;
		}
	
		.titleNview-background {
			// background: #BE473F; //轮播图后面暂时的静态背景色
			// opacity: 0.9;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 280upx;
			transition: .4s;
		}
	}
	.carousel {
		width: 100%;
		height: 280upx;
		text-align: center;
	
		.carousel-item {
			top: 30upx;
			width: 100%;
			height: 280upx;
			overflow: hidden;
		}
	
		image {
			width: 94%; // 设置 轮播图片宽度
			height: 100%;
			border-radius: 10upx;
		}
	}
	.swiper-dots {
		display: flex;
		position: absolute;
		left: 60upx;
		bottom: 30upx;
		width: 72upx;
		height: 36upx;
		background-image: url();
		background-size: 100% 100%;
	
		.num {
			width: 36upx;
			height: 36upx;
			border-radius: 50px;
			font-size: 24upx;
			color: #fff;
			text-align: center;
			line-height: 36upx;
		}
	
		.sign {
			position: absolute;
			top: 0;
			left: 50%;
			line-height: 36upx;
			font-size: 12upx;
			color: #fff;
			transform: translateX(-50%);
		}
	}
	/* 分类 */
	.cate-section {
		display: flex;
		justify-content: space-around;
		align-items: center;
		flex-wrap:wrap;
		padding: 30upx 22upx; 
		background: #fff;
		.cate-item {
			display: flex;
			flex-direction: column;
			align-items: center;
			// font-size: $font-sm + 2upx;
			// color: $font-color-dark;
		}
		/* 原图标颜色太深,不想改图了,所以加了透明度 */
		image {
			width: 88upx;
			height: 88upx;
			margin-bottom: 14upx;
			border-radius: 50%;
			opacity: .7;
			box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
		}
	}
	.ad-1{
		width: 100%;
		height: 210upx;
		padding: 10upx 0;
		background: #fff;
		image{
			width:100%;
			height: 100%; 
		}
	}
	.p_father {
		width: 100%;
		height: 330upx;
		display: flex;
		justify-content: space-between;
		margin-bottom: 16upx;
	}
	.p_left {
		margin: 0 10upx;
		width: 40%;
		flex: 1;
	}
	.p_left image {
		width: 100%;
		height: 100%;
	}
	.p_right {
		margin: 0 10upx;
		width: 40%;
		flex: 1;
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
	}
	.img_top {
		flex: 1;
		height: 50%;
		// height: 170upx;
		width: 100%;
	}
	.img_top image{
		width: 98%;
		height: 98%;
	}
	.img_bottom {
		flex: 1;
		height: 50%;
		// height: 170upx;
		width: 100%;
		display: flex;
	}
	.img_bottom view {
		flex: 1;
		width: 50%;
		line-height: 1;
	}
	.img_bottom view:nth-child(1) image {
		width: 98%;
		height: 98%;
		// margin: 0 4% 4% 0;
	}
	.img_bottom view:nth-child(2) image {
		width: 98%;
		height: 98%;
		// margin: 0 0% 4% 4%;
	}
	.tab_choose {
		height: 100upx;
		display: flex;
		background-color: #fff;
		color: #05052B;
	}
	.padleft {
		color: #333;
		padding-left: 4upx;
	}
	.menu_son {
		line-height: 100upx;
		flex: 1;
		text-align: center;
	}
	.flexbox {
		display: flex;
		flex-wrap: wrap;
	}
	.flexboxson {
		width: 25%;
	}
	.block {
		padding: 8upx;
	}

	.item {
		float: left;
		width: 50%;
		padding: 10upx;
		box-sizing: border-box;
	}

	.one .item {
		width: 100%;
	}

	.three .item {
		width: 33.33%;
	}

	.triangle {
		width: 100%;
		height: 346upx;
		display: block;
	}

	.one .triangle {
		height: 714upx
	}

	.three .triangle {
		height: 224upx
	}

	.detail {
		background: #fff;
		padding: 20upx 12upx;
	}

	.name {
		height: 68upx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		font-size: 24upx;
		line-height: 36upx;
	}

	.price text {
		display: block;
		line-height: 40upx;
	}

	.price {
		margin-top: 12upx;
		color: #05052B;
	}

	.mask {
		position: fixed;
		z-index: 998;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
		background: rgba(0, 0, 0, .6);
	}

	.mask,
	.tips {
		display: none;
	}

	.mask.show,
	.gengxing.show {
		display: block !important;
	}
	.gengxing {
		position: fixed;
		z-index: 99999;
		width: 480upx;
		height: 738upx;
		top: 50%;
		left: 50%;
		margin-left: -240upx;
		margin-top: -380upx;
		background-size: cover;
		display: none;
		overflow: hidden;
	}

	.gengxing .title {
		position: absolute;
		top: 340upx;
		text-align: center;
		color: #db3737;
		font-size: 40upx;
		font-weight: 600;
		width: 220upx;
		left: 50%;
		margin-left: -110upx;
		line-height: 44upx;
		z-index: 999;
	}

	.gengxing .title text {
		font-weight: initial;
		font-size: 24upx;
		color: #fff;
		background: #db3737;
		border-radius: 100upx;
		padding: 0 10upx;
		position: absolute;
		line-height: 36upx;
		bottom: 0;
		left: 100%;
		z-index: 999;
	}

	.dl {
		position: absolute;
		bottom: 0;
		background: transparent;
		font-size: 34upx;
		width: 100%;
		color: #fff;
		line-height: 100upx;
		z-index: 999;
	}
	
	
	.d-header{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 80upx;
		// font-size: $font-base + 2upx;
		// color: $font-color-dark;
		position: relative;
			
		text{
			padding: 0 20upx;
			background: #fff;
			position: relative;
			z-index: 1;
		}
		&:after{
			position: absolute;
			left: 50%;
			top: 50%;
			transform: translateX(-50%);
			width: 300upx;
			height: 0;
			content: '';
			border-bottom: 1px solid #ccc;
		}
	}
</style>
